#include<bits/stdc++.h>

using namespace std;

char s[3000010];
int main()
{
	int t;
	int sum;
    cin>>t;
    while(t--)
	{
        int n,i;
        char c;
		sum = 0;
        cin>>n>>c>>s;
        for(int i = 0; i <= n - 1; i++)
        {
        	if(s[i] == c) sum++;
		}
		if(n == sum)
		{
			cout<<"0"<<endl;
			continue;
		}
        for(i = n - 1; i >= n / 2; i--)
        {
        	if(s[i] == c)
        	{
        		cout<<"1"<<endl<<i+1<<endl;
        		break;
			}
		}
		if(i < n / 2)
		{
			cout<<"2"<<endl<<n<<" "<<n-1<<endl;
		}
	}
    return 0;
} 
